﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Maticsoft.DBUtility;
using System.Data.SqlClient;

namespace ElingOA6_Admin_DSJCJ.DAL
{
    /// <summary>
    /// 相册类别权限 数据类
    /// </summary>
    public class AlbumAuth
    {
        public AlbumAuth()
        {
        }
        /// <summary>
        /// 根据相册类别编码获取人员列表
        /// <creator>wangl</creator>
        /// <date>2014-10-11</date>
        /// </summary>
        /// <param name="albumClsNo">相册类别编码</param>
        /// <param name="fentityNo">组织机构代码</param>
        /// <returns>人员列表</returns>
        public List<string> GetEmplNoListByAlbumClsNo(string albumClsNo, string fentityNo)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select FEmplNo ");
            strSql.Append(" FROM t_AlbumAuth ");
            strSql.Append(" WHERE FAlbumClsNo=@FAlbumClsNo and FEntityNo=@FEntityNo");
            SqlParameter[] parameters = {
					new SqlParameter("@FAlbumClsNo", SqlDbType.NVarChar,30),
                    new SqlParameter("@FEntityNo", SqlDbType.NVarChar,12)
                                           };
            parameters[0].Value = albumClsNo;
            parameters[1].Value = fentityNo;
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            List<string> emplNoList = new List<string>();
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                emplNoList.Add(ds.Tables[0].Rows[i]["FEmplNo"].ToString());
            }

            return emplNoList;
        }
    }
}
